<script setup lang="ts">
import { ref, onMounted } from 'vue'
// 引入store登录数据
import { useShopInfoStore } from '@/store/modules/shopInfo/index'

// 引入store登录数据
const $userStore = useShopInfoStore()
const show = ref(false)
onMounted(() => {
    // 判断是否登录
    const { token } = $userStore.getterShopInfo
    if (!token) {
        show.value = true
    }
})

const handleNavToSign = () => {
    uni.redirectTo({
        url: '/pages/sign/index',
    })
}
</script>

<template>
    <u-modal
        v-model="show"
        :show-title="false"
        :content="'还未登录 请登录后查看'"
        :show-cancel-button="false"
        :confirm-text="'登录'"
        @confirm="handleNavToSign"
    ></u-modal>
</template>

<style lang="scss" scoped></style>
